package FlyGame;

import javax.swing.*;
import java.awt.*;

public class MyBird {
    public int Birdx;
    public int Birdy;
    public int deadline;
    public int Birdh;
    public int Birdw;
    public int speed;
    public int status;
    public Rectangle rect;
    public ImageIcon birdImage;
    public ImageIcon birdupImage;

    public MyBird() {
        this.status = 0;
        this.speed = 3;
        this.Birdx = 50;
        this.Birdy = 200;
        deadline = 500 - new BackDown().getBky() - 20;
        this.Birdh = FlyPicture.Bird.getIconHeight();
        this.Birdw = FlyPicture.Bird.getIconWidth();
        rect = new Rectangle(this.Birdw, this.Birdh);
    }

    public Rectangle getRect() {
        return rect;
    }

    public void paintBird(Graphics g, JPanel panel) {
        if(status == 0){
            this.birdImage.paintIcon(panel, g, this.Birdx, this.Birdy);
        }
        else {
            this.birdupImage.paintIcon(panel, g, this.Birdx, this.Birdy);
        }
        this.rect.x = this.Birdx;
        this.rect.y = this.Birdy;

    }
}
